#!/bin/sh
#
# This is an ugly solution for linux-igd, which doesn't
# reference the config file with its startup script. Need
# to create new linux-igd package with proper startup script.
#
. /lib/config/uci-depends.sh
. /lib/config/uci.sh
uci_load "upnpd"
if [ "$CONFIG_general_enable" = "0" ] && [ -f "/etc/init.d/S65upnpd" ]; then
	echo "Stopping UPNP daemon ..."
	# try to do it right
	./S65upnpd stop
	# but don't trust it
	killall upnpd
fi
